package views;

import java.util.List;

import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;

import entity.TaskInfo;

public class TaskInfoLabelProvider implements ITableLabelProvider {
	  public Image getColumnImage(Object element, int columnIndex) {
	    return null;
	  }

	  public String getColumnText(Object element, int columnIndex) {
		  if (element instanceof List<?>) {
			  return "";
		  }
			  
	    TaskInfo taskInfo = (TaskInfo) element;
	    switch (columnIndex) {
	    case 0:
	      return taskInfo.getDescription();
	    case 1:
	      return Boolean.toString(taskInfo.isActive());
	    case 2:
	      return taskInfo.getTargetModule();
	    case 3:
	      return "no errors";
	    case 4:
		  return taskInfo.getParameters().toString();
	    }
	    return null;
	  }

	  public void addListener(ILabelProviderListener listener) {
	  }

	  public void dispose() {
	  }

	  public boolean isLabelProperty(Object element, String property) {
	    return false;
	  }

	  public void removeListener(ILabelProviderListener listener) {
	  }
	}